# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application")
load("@rules_java//java:defs.bzl", "java_library")

ios_application(
    name = "Contacts",
    bundle_id = "com.google.j2objc.example.contacts",
    families = [
        "iphone",
        "ipad",
    ],
    infoplists = ["src/Info.plist"],
    minimum_os_version = "11.4",
    deps = [":ContactsMainLib"],
)

objc_library(
    name = "ContactsMainLib",
    srcs = glob(["src/*.m"]),
    hdrs = glob(["src/*.h"]),
    data = ["//resources"],
    sdk_frameworks = ["CoreGraphics"],
    deps = [":ContactsJava"],
)

j2objc_library_legacy(
    name = "ContactsJava",
    jre_deps = ["@bazel_j2objc//:jre_net_lib"],
    deps = [":ContactsJavaLib"],
)

java_library(
    name = "ContactsJavaLib",
    srcs = glob(["src/java/org/contacts/*.java"]),
)
